﻿using System;
using Microsoft.Practices.Unity;

namespace ReactiveGraph.Core.Configuration.Containers
{
    public class UnityCoreExtension : UnityContainerExtension
    {
        protected override void Initialize()
        {
            var id = 1;
           
            Container.RegisterType<Func<IReactiveNode, string>>(
                new ContainerControlledLifetimeManager(),
                new InjectionFactory(c =>
                                     new Func<IReactiveNode, string>(
                                         node => node.GetType().Name + id++))
                );
            Container.RegisterType<IReactiveNode, ReactiveNode>();
            
        }

       

    }
}
